<template>
	<BaseContainer>
		<aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig">
      <template v-slot:beAreaNames="{ row }">
				{{ row.beAreaName || row.beCityName || row.beProvinceName }}
			</template>
			<template v-slot:chatMsg="{ row }">
				<el-button size="small" type="primary" @click="handleOperate(row)">查看</el-button>
			</template>
			<template v-slot:chatMsgDetail="{ row,model }">
				<el-scrollbar max-height="40vh" style="width:100%">
					<ChatContent :nowRowData="model" class="w-100"></ChatContent>
				</el-scrollbar>
			</template>
		</aplid-base-crud>

		<el-drawer v-model="drawer" title="问询内容" append-to-body>
			<ChatContent v-if="drawer" :nowRowData="nowRowData"></ChatContent>
		</el-drawer>
	</BaseContainer>
</template>

<script setup lang="ts">
import { baseConfig } from './config'
import ChatContent from './ChatContent.vue'

const drawer = ref(false)
const nowRowData: any = ref({})
const handleOperate = (row) => {
	drawer.value = true
	nowRowData.value = {
		...row,
	}
}
</script>

<style lang="scss" scoped></style>
